Skip to content

[4.4] Allow the symfony/flex plugin #12

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 12, 2022

Conversation

alexislefebvre
Copy link
Contributor

@alexislefebvre alexislefebvre commented Jul 8, 2022

It should fix the test of symfony/symfony-docs#16883:

git clone -b 4.4 --depth 5 --single-branch https://github.com/symfony-tools/symfony-application.git _sf_app
#
Error: symfony/flex contains a Composer plugin which is blocked by your allow-plugins config. You may add it to the list if you consider it safe.
You can run "composer config --no-plugins allow-plugins.symfony/flex [true|false]" to enable it (true) or disable it explicitly and suppress this exception (false)

full log


I took the conf from #11

@javiereguiluz
Copy link

Thanks for this fix.

A minor comment: even if CI is green after this change, in a repository of mine this change wasn't enough to fix GitHub actions. Apparently, that was the case for other projects too. @jmsche helped me find the right solution, which was to run this command before installing dependencies:

composer config --global --no-plugins allow-plugins.symfony/flex true

@alexislefebvre
Copy link
Contributor Author

This fix should work for the job since it clones the repository then cd in the directory, so the composer.json I changed will be used.

@javiereguiluz in your case, you may have to update the main composer.json to allow the plugin.

This behaviour is active since July 1st: https://github.com/composer/composer/blob/d17c724f2323d16a38c2cbd4cdbb271f0febb1f9/src/Composer/PHPStan/ConfigReturnTypeExtension.php#L173-L176

@javiereguiluz
Copy link

javiereguiluz commented Jul 11, 2022

Here are some details:

(1) In this commit: EasyCorp/EasyAdminBundle@9f24622 I made the same change as in this PR

(2) Tests failed: https://github.com/EasyCorp/EasyAdminBundle/runs/7246915457?check_suite_focus=true

(3) Then I added another commit with the solution provided above: EasyCorp/EasyAdminBundle@c695106

(4) After that change, tests no longer failed: https://github.com/EasyCorp/EasyAdminBundle/runs/7262587454?check_suite_focus=true

But my comment is only a "for your information" message. If this PR works without doing any other change, then it's great.

@jmsche
Copy link

jmsche commented Jul 11, 2022

Both cases are different: this app includes Flex directly in it, while EA repo installs Flex globally so the CI can install a specific version of Symfony, hence the fix applied here works.

@alexislefebvre
Copy link
Contributor Author

alexislefebvre commented Jul 11, 2022

@javiereguiluz this may be an issue with the global mode of Composer, by dropping it I was able to allow the plugin in composer.json and install it: alexislefebvre/EasyAdminBundle#1

I can't submit a PR to EasyAdminBundle, feel free to submit the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

7 participants